package com.minimalist.basic.entity.po.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;

// Auto generate by mybatis-flex, do not modify it.
public class MDeptTableDef extends TableDef {

    /**
     * 部门表 实体类。

 @author 小太阳
 @since 2024-10-18
     */
    public static final MDeptTableDef MDEPT = new MDeptTableDef();

    /**
     * ID自增
     */
    public final QueryColumn ID = new QueryColumn(this, "id");

    /**
     * 邮箱
     */
    public final QueryColumn EMAIL = new QueryColumn(this, "email");

    /**
     * 联系电话
     */
    public final QueryColumn PHONE = new QueryColumn(this, "phone");

    /**
     * 部门id
     */
    public final QueryColumn DEPT_ID = new QueryColumn(this, "dept_id");

    /**
     * 状态  0禁用 1正常
     */
    public final QueryColumn STATUS = new QueryColumn(this, "status");

    /**
     * 逻辑删除
     */
    public final QueryColumn DELETED = new QueryColumn(this, "deleted");

    /**
     * 版本号
     */
    public final QueryColumn VERSION = new QueryColumn(this, "version");

    /**
     * 创建人ID
     */
    public final QueryColumn CREATE_ID = new QueryColumn(this, "create_id");

    /**
     * 部门名称
     */
    public final QueryColumn DEPT_NAME = new QueryColumn(this, "dept_name");

    /**
     * 显示顺序
     */
    public final QueryColumn DEPT_SORT = new QueryColumn(this, "dept_sort");

    /**
     * 租户编号
     */
    public final QueryColumn TENANT_ID = new QueryColumn(this, "tenant_id");

    /**
     * 更新人ID
     */
    public final QueryColumn UPDATE_ID = new QueryColumn(this, "update_id");

    /**
     * 祖级列表
     */
    public final QueryColumn ANCESTORS = new QueryColumn(this, "ancestors");

    /**
     * 创建时间
     */
    public final QueryColumn CREATE_TIME = new QueryColumn(this, "create_time");

    /**
     * 部门负责人
     */
    public final QueryColumn DEPT_LEADER = new QueryColumn(this, "dept_leader");

    /**
     * 更新时间
     */
    public final QueryColumn UPDATE_TIME = new QueryColumn(this, "update_time");

    /**
     * 父部门id
     */
    public final QueryColumn PARENT_DEPT_ID = new QueryColumn(this, "parent_dept_id");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, EMAIL, PHONE, DEPT_ID, STATUS, VERSION, CREATE_ID, DEPT_NAME, DEPT_SORT, TENANT_ID, UPDATE_ID, ANCESTORS, CREATE_TIME, DEPT_LEADER, UPDATE_TIME, PARENT_DEPT_ID};

    public MDeptTableDef() {
        super("", "m_dept");
    }

    private MDeptTableDef(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    @Override
    public MDeptTableDef as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new MDeptTableDef("", "m_dept", alias));
    }

}
